package kr.hkit.powerjava.chapter11.work;

public class Triangle extends Shape {
	private int width; //빗변
	private int height; //높이
	
	public Triangle() {	}
	
	public Triangle(int width, int height) {
		super();
		this.width = width;
		this.height = height;
	}
	
	public int getWidth() {
		return width;
	}

	public void setWidth(int width) {
		this.width = width;
	}

	public int getHeight() {
		return height;
	}

	public void setHeight(int height) {
		this.height = height;
	}

	@Override
	public int size() {
		super.setSize(3*width);
		return super.getSize();
	}

	@Override
	public double area() {
		super.setArea(height*width);
		return super.getArea();
	}

	@Override
	public String toString() {
		return "Triangle [빗변 = " + width + ", 높이 = " + height
				+ ", 둘레 = " + getSize() + ", 면적 = " + getArea() + "]";
	}

}
